//
//  SecureUserInformation.m
//  TestCoreData
//
//  Created by Administrator on 5/24/13.
//  Copyright (c) 2013 Administrator. All rights reserved.
//

#import "SecureUserInformation.h"

@implementation SecureUserInformation

- (NSString*) password
{
    if (self.username) {
        return [KeyChainHelper getPasswordForKey:self.username];
    }
    return nil;
}

-(NSString*)getPasswordFromKeychain
{
    if (self.username)
        return [KeyChainHelper getPasswordForKey:self.username];
    return nil;
}

- (void) setPassword:(NSString *)aPassword
{
    NSLog (@"Get here to setPassword");
    if (self.username) {
        [KeyChainHelper setPassword:aPassword forKey:self.username];
    }
}

- (void)prepareForDeletion
{
    if (self.username) [KeyChainHelper removePasswordForKey:self.username];
}
@end
